<div style="width: 100%; height: 100%; overflow-y:auto">
    <div class="step1">
        <div class="important">
            <span class="f">!</span>请先转账成功后再点“下一步”按钮提交存款信息！
        </div>
    
        <div class="charge_item banklist">
            <select data-am-selected class="am-form-field">
            </select>
        </div>
    
        <div class="bankinfo">
        </div>
    
        <div class="button2 bank">
            <button type="button" class="am-btn am-btn-primary btn-save">下一步</button>
        </div>
    </div>
    
    <div class="step2" style="display: none;">
        <div class="charge_item amount">
            <input type="number" class="am-form-field" placeholder="请填写存款金额" />
        </div>
        <div class="clue">
            单笔下限<span class="red min">10</span>，单笔上限<span class="red max">9999999</span>
        </div>
    
        <div class="common_container">
            <div class="charge_item name">
                <input type="text" class="am-form-field" placeholder="请填写付款备注信息" />
            </div>
    
            <div class="charge_item time">
                <input type="text" value="" class="am-form-field" placeholder="" data-am-datepicker readonly />
            </div>
        </div>
    
        <div class="button2 bank">
            <button type="button" class="am-btn am-btn-primary btn-save">提交</button>
        </div>
    </div>
    
    <div class="step3" style="display: none">
        <div class="important">
            <span class="f">!</span>为了加快入款速度，请务必于转账后再提交资料！
        </div>
        <div class="charge-title">存款信息</div>
        <div class="charge_info">
            <div class="c1">存入金额：<span class="red">0.00</span></div>
            <div class="c3">账户信息：<span></span></div>
            <div class="c2">备 注 码：<span></span></div>
            <div class="c4">存款时间：<span></span></div>
            <div class="c5">存款方式：<span>QQ钱包转账</span></div>
        </div>
        <div class="charge-title">微信账户信息</div>
        <div class="bank_info">
            <div class="c1">姓 名：<span></span></div>
            <div class="c2">账 号：<span>扫码后 付款备注（存款人姓名）</span></div>
        </div>
    
        <div class="button2 bank">
            <button type="button" class="am-btn am-btn-primary btn-save">提交申请</button>
        </div>
    </div>
    </div>
    
    <style type="text/css">
    .step1, .step2, .step3 {
        padding: 10px;
        font-size: 0.6rem;
    }
    .bankinfo img {
        border: 1px solid #ccc;
        border-radius: 8px;
    }
    .bankinfo .qrcode {
        padding: 10px 0px 10px 0px;
    }
    </style>
    
    <script>
        $("#center-top .home").hide();
        $("#center-top .back").show();
        $("#center-top .menu").hide();
        $("#center-top .back2game").show();
        
        $("#clue2 #clue2_content").html("<div style='text-align:left'>1、请使用手机截屏功能保存二维码，登录QQ扫一扫转账<br>\
        2、转账时在“备注”处填写备注码，提交订单后才能秒到！备注码是4位数，不要填写中文。</div>");
        $("#clue2").modal({
            width: 250
        });
    
        // 生成付款码
        var code = '';
        for (var i = 0; i < 4; i++)
            code += '' + parseInt(Math.random() * 10);
    
        var currStep = 1;
        $(".step1 button").click(function() {
            currStep = 2;
            $(".step1").hide();
            $(".step2").show();
            $(".step3").hide();
        });
    
        var banks = [];
        ME.query(function() {
            Classify.queryExt("money", "cft", true, [], function(r) {
                var grade = context.user.user.layer || 0;
                grade = grade + '';
                for (var i in r) {
                    if (r[i].enable != 1) continue;
                    if (r[i].layer.indexOf(grade) == -1) continue;
                    banks.push(r[i]);
                }
                banks.sort(function(a, b) {
                    return (b.sort || 0) - (a.sort || 0);
                });
                
                // 填充银行列表
                var list = $(".banklist select");
                list.empty();
                for (var i in banks) {
                    var bank = banks[i];
                    list.append('<option value="' + bank.account + '">' + bank.account + '</option>');
                }
                fillBankInfo();
            });
        });
    
        function fillBankInfo() {
            var b = $(".banklist select").val();
            var bank;
            for (var i in banks) {
                if (banks[i].account == b) {
                    bank = banks[i];
                    break;
                }
            }
            if (!bank) return;
            $(".bankinfo").empty();
            $(".bankinfo").append('<div class="item"><div class="title">姓 名：</div>' +
                '<div class="v">' + bank.account + '</div></div>');
            $(".bankinfo").append('<div class="item"><div class="title">账 号：</div>' +
                '<div class="v">' + '扫码后 付款备注（存款人姓名）' + '</div></div>');
            $(".bankinfo").append('<div class="item qrcode"><div class="title">地 址：</div>' +
                '<div class="v"><img width="150" height="150" src="' + context.config.url + bank.qrcode + '"/></div></div>');
            $(".bankinfo").append('<div class="item"><div class="title">备注码：</div>' +
                '<div class="v" style="color:red; font-weight:bold;">' + code + '</div></div>');
    
            $("span.min").html(bank.min || 0);
            $("span.max").html(bank.max || 0);
        }
        $(".banklist select").change(fillBankInfo);
        $(function() {
            $(".time input").datetimepicker({
                format: "yyyy-mm-dd hh:ii:ss"
            });
            $(".time input").val(new Date().Format("yyyy-MM-dd HH:mm:ss"));
        });
    
        $(".step2 button").click(function() {
            var amount = $(".amount input").val().trim();
            if (amount == '' || parseInt(amount) < parseInt($("span.min").html()) || 
                parseInt(amount) > parseInt($("span.max").html())) {
                alert2("金额不对！");
                return;
            }
    
            var b = $(".banklist select").val();
            var bank;
            for (var i in banks) {
                if (banks[i].account == b) {
                    bank = banks[i];
                    break;
                }
            }
            if (!bank) return;
    
            var name = $(".name input").val();
            if (!name) {
                alert2("请填写转账的QQ账号！");
                return;
            }
            var time = $(".time input").val();
    
            // 进入第三步
            currStep = 3;
            $(".step1").hide();
            $(".step2").hide();
            $(".step3").show();
    
            $(".step3 .charge_info .c1 span").html(amount);
            $(".step3 .charge_info .c3 span").html(name);
            $(".step3 .charge_info .c2 span").html(code);
            $(".step3 .charge_info .c4 span").html($(".time input").val());
            $(".step3 .bank_info .c1 span").html(bank.account);
        });
    
        $(".step3 button").click(function() {
            var amount = $(".amount input").val().trim();
            var b = $(".banklist select").val();
            var bank;
            for (var i in banks) {
                if (banks[i].account == b) {
                    bank = banks[i];
                    break;
                }
            }
            var memo = {
                time: $(".time input").val(),
                name: bank.name,
                account: bank.account,
                requestAccount: $(".name input").val(),
                code: code,
            };
            
            startLoading();
            CMD.deposit(null, "", amount * 100, "handOper", "wechat", memo, function(r) {
                stopLoading();
                if (r.message) {
                    alert2(r.message);
                    return;
                }
                alert2("提交请求成功，请等待客服审核");

                setTimeout(function() {
                Util.jumpUrl({
                    cmd: 'charge'
                });
            }, 1500);
            })
        });
    
    </script>